var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, n) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var n in t)
              Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
          })(t, n);
      };
      return function (t, n) {
        function i() {
          this.constructor = t;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        e(t, n),
          (t.prototype =
            null === n
              ? Object.create(n)
              : ((i.prototype = n.prototype), new i()));
      };
    })(),
  AXDressEquipmentDialog = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.list_dressequipment.selectEnable = !0),
        (t.list_dressequipment.vScrollBarSkin = ""),
        t.list_dressequipment.on(
          Laya.Event.CLICK,
          t,
          t.onDidClickDressEquipmentFn
        ),
        WebSocketService.addListener({
          caller: t,
          code: 1108,
          method: t.onLoadEquipmentListData,
        }),
        WebSocketService.addListener({
          caller: t,
          code: 4482,
          method: t.onLoadEquiOperationDataFn,
        }),
        t
      );
    }
    return (
      __extends(t, e),
      (t.showDressEquipmentOpen = function (e, n) {
        null == this.dressequView &&
          ((this.dressequView = new t()), (this.dressequView.zOrder = 1e3)),
          this.dressequView.popup(),
          (this.dressequView.subID = e),
          (this.dressequView.loctionIndex = n),
          (this.dressequView.suboard_action = "1"),
          WebSocketService.send({ c: 1108, d: { pageNum: 0 } });
      }),
      (t.prototype.onLoadEquipmentListData = function (e) {
        (this.dataArr = e.data), (this.dataSource = []);
        for (var t, n = 0; n < this.dataArr.length; n++)
          (t = {
            label_cdzb_name: { text: this.dataArr[n].name },
            label_cdzb_describle: { text: this.dataArr[n].stoneStr },
            btn_cdzb_name: { label: "穿戴" },
            name: this.dataArr[n].name,
          }),
            this.dataSource.push(t);
        this.list_dressequipment.array = this.dataSource;
      }),
      (t.prototype.onDidClickDressEquipmentFn = function (e) {
        if ("" != e.target.name && "btn_cdzb_name" == e.target.name) {
          var t = this.dataArr[this.list_dressequipment.selectedIndex];
          WebSocketService.send({
            c: 4482,
            d: {
              action: this.suboard_action,
              cid: this.subID,
              aid: t.id,
              location: this.loctionIndex,
            },
          });
        }
      }),
      (t.prototype.onLoadEquiOperationDataFn = function (e) {
        t.close();
      }),
      (t.close = function () {
        this.dressequView && this.dressequView.close();
      }),
      t
    );
  })(ui.SuboardinateController.AXDressEquipmentDialogUI);
